//顶部切换
$(".sec-banner1-btn i").each((i)=> {
    let index = i;
    $(".sec-banner1-btn i").eq(i).mouseover(() => {
        $(".sec-banner1-btn i").each((j) => {
            $(".sec-banner1-btn i").eq(j).css("background", "#666666");
        });
        $(".sec-banner1-btn i").eq(index).css("background", "#eb8c27");
        $(".sec-banner1").css("background", `url("img/banner-${index}.png") no-repeat center`);
    });
});
//设计团队切换
$(".designer-team-banner-btn i").each((i)=> {
    let index = i,
        bool;
    i % 2 ? bool = 2 : bool = 1;
    $(".designer-team-banner-btn i").eq(i).mouseover(() => {
        $(".designer-team-banner-btn i").each((j) => {
            $(".designer-team-banner-btn i").eq(j).css("background", "#666666");
        });
        $(".designer-team-banner-btn i").eq(index).css("background", "#eb8c27");
        $(".designer-team-banner-img img").attr("src", `img/renwu_${bool}.png`);
    });
});
//设计方案加载
$.ajax({
    type: "get",
    url: "http://www.shouziliu.com/LTO/design/",
    success: (data) => {
        data.style.forEach((content, index) => {
            $(".scheme-design-bac").append(`
                 <div class="scheme-design-content">
                    <i><img src="img/design_${content.src}" alt=""></i>
                    <div class="scheme-design-txt">
                        <h1 class="color-org">${content.title}</h1>
                        <p class="color-gry">${content.text}</p>
                        <p><a href="design.html"><span>更多风格</span><span>》</span></a></p>
                    </div>
                </div>
                     `);
        });
    }
});
//设计方案轮播
let Index=2;
function booBtn() {
    if (Index == 0) {
        $('.scheme-design-left').css("color", "#eb8c27");
        $('.scheme-design-right').css("color", "white");
    }
    else if (Index == 2) {
        $('.scheme-design-left').css("color", "white");
        $('.scheme-design-right').css("color", "#eb8c27");

    }
    else {
        $('.scheme-design-btn').css("color", "#eb8c27");
    }
}
$(".scheme-design-right").click(()=> {
    if(Index>0){
        $(".scheme-design-content").eq(Index).addClass("go");
        Index > 0 ? Index -= 1 : Inedx = 0;
        booBtn();
        setTimeout(() => {
            $(".scheme-design-content").eq(Index+1).addClass("none");
        },800);
    }
});
$(".scheme-design-left").click(()=> {
    if(Index<2){
        Index < 2 ? Index += 1 : Index = 2;
        $(".scheme-design-content").eq(Index).removeClass("none");
        setTimeout(() => {
            $(".scheme-design-content").eq(Index).removeClass("go");
            booBtn();
        });
    }
});
//行业动态切换
$(".industry-news-content span").eq(0).click(function () {
    $(this).parent().children().css("border-bottom","1px solid transparent");
    $(this).css("border-bottom","1px solid #eb8c27");
    $('.industry-news-imgs:nth-of-type(2)').addClass('industry-news-imgs-show');
});
$(".industry-news-content span").eq(1).click(function(){
    $(this).parent().children().css("border-bottom","1px solid transparent");
    $(this).css("border-bottom","1px solid #eb8c27");
    $('.industry-news-imgs:nth-of-type(2)').removeClass('industry-news-imgs-show');
})




